rats$treat <- as.factor(rats$treat)
rats$rat <- as.factor(rats$rat)
rats$liver <- as.factor(rats$liver)
lmer(gycog ~ treat + (1 | treat/rat/liver), data = rats)
lmer(glycog ~ treat + (1 | treat/rat/liver), data = rats)
lmer(glycog ~ treat + (1 | treat:rat + rat:liver), data = rats)
lmer(glycog ~ treat + (1 | treat:rat) + (1 | treat:rat:liver), data = rats)
rats.lmer<-lmer(glycog ~ treat + (1 | treat:rat) + (1 | treat:rat:liver), data = rats)
visreg(rats.lmer)
anova(rats.lmer)
summary(rats.lmer)
TR <- as.fixed(rats$treat)
RA <- as.random(rats$rat)
LI <- as.random(rats$liver)
rats.lm <- lm(glycog ~ TR + RA %in% TR + LI %in% RA %in% TR, data = rats)
gad(rats.lm)
aggregate(phen.ach ~ fenced, data = d, var)
aggregate(phen.ach ~ fenced * fertilized, data = d, mean)
var
rm(var)
aggregate(phen.ach ~ fenced, data = d, var)
aggregate(phen.ach ~ fertilized, data = d, var)
aggregate(phen.ach ~ fertilized, data = d, sd)
aggregate(phen.ach ~ fenced, data = d, sd)
levene.Test(phen.ach ~ fenced, data = d)
library(car)
levene.Test(phen.ach ~ fenced, data = d)
leveneTest(phen.ach ~ fenced, data = d)
leveneTest(phen.ach ~ fertilized, data = d)
leveneTest(phen.ach ~ permanent, data = d)
ggplot(data = d, aes(x = fenced, y = log.phen)) +
facet_grid(cols = vars(fertilized)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = permanent)) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Fenced", y = "Phen.ACH (log)", color = "Permanent")
leveneTest(log.phen ~ permanent, data = d)
setwd("~/Downloads")
x <- read.csv("kluane.csv")
x$treatment <- as.factor(x$treatment)
x <- read.csv("kluane.csv")
x$treatment <- as.factor(x$treatment, levels = c("control", "fenced", "fertilized", "both"))
x$treatment <- factor(x$treatment, levels = c("control", "fenced", "fertilized", "both"))
x <- read.csv("kluane.csv")
x$treatment <- factor(x$treatment, levels = c("control", "fenced", "fertilized", "both"))
x <- read.csv("kluane.csv")
x$treatment <- factor(x$treatment, levels = c("control", "fenced", "fertilized", "both"))
x$plot <- as.factor(x$plot)
relevel()
x <- read.csv("kluane.csv", stringsAsFactors = FALSE)
x$plot <- as.factor(x$plot)
x$treatment <- factor(x$treatment, levels = c("control", "fenced", "fertilized", "both"))
x$duration <- factor(x$duration, levels = c("permanent", "reverse"))
x <- read.csv("kluane.csv", stringsAsFactors = FALSE)
x$plot <- as.factor(x$plot)
x$treatment <- factor(x$treatment, levels = c("control", "fenced", "fertilized", "both"))
x$duration <- factor(x$duration, levels = c("reverse", "permanent"))
x.lmer <- lmer(phen.ach ~ treatment + (1|plot) + duration, data = x)
library(lme4)
x.lmer <- lmer(phen.ach ~ treatment + (1|plot) + duration, data = x)
library(visreg)
visreg(x.lmer)
library(visreg)
visreg(x.lmer)
x
x <- read.csv("kluane.csv", stringsAsFactors = FALSE)
x$treatment <- factor(x$treatment, levels = c("control", "enclosure", "fertilizer", "both"))
x
x <- read.csv("kluane.csv", stringsAsFactors = FALSE)
x$treatment <- factor(x$treatment, levels = c("control", "enclosed", "fertilizer", "both"))
x
x <- read.csv("kluane.csv", stringsAsFactors = FALSE)
x
x$treatment <- factor(x$treatment, levels = c("control", "exclosure", "fertilizer", "both"))
x
x$duration <- factor(x$duration, levels = c("reverse", "permanent"))
x$plot <- as.factor(x$plot)
x.lmer <- lmer(phen.ach ~ treatment + (1|plot) + duration, data = x)
visreg(x.lmer)
x$phen.log <- log(x$phen.ach)
x.lmer <- lmer(phen.ach ~ treatment + (1|plot) + duration, data = x)
x.lmer <- lmer(log.phen ~ treatment + (1|plot) + duration, data = x)
x.lmer <- lmer(phen.log ~ treatment + (1|plot) + duration, data = x)
visreg(x.lmer)
stripchart(log(phen.ach) ~ treatment, vertical=TRUE,
data=x, method="jitter", pch="")
points( log(phen.ach) ~ c(as.numeric(treatment)-0.1),
data=subset(x, duration=="permanent"), pch=16)
points( log(phen.ach) ~ c(as.numeric(treatment)+0.1),
data=subset(x, duration=="reverse"), pch=1)
stripchart(phen.ach ~ treatment, vertical=TRUE,
data=x, method="jitter", pch="")
points( phen.ach ~ c(as.numeric(treatment)-0.1),
data=subset(x, duration=="permanent"), pch=16)
points( phen.ach ~ c(as.numeric(treatment)+0.1),
data=subset(x, duration=="reverse"), pch=1)
ggplot(data = x, aes(x = duration, y = phen.ach)) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
library(ggplot2)
ggplot(data = x, aes(x = duration, y = phen.ach)) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
library(ggthemes)
ggplot(data = x, aes(x = duration, y = phen.ach)) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach), group = plot)) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, group = plot) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(group = plot)) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) + geom_line(aes(group = plot))
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) + geom_line(aes(group = plot)) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) + geom_line(aes(group = plot)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = plot)) + geom_line(aes(group = plot, col = plot)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3) + geom_line(aes(group = plot)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.1, alpha = 0.5) + geom_line(alpha = 0.3, aes(group = plot)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
ggplot(data = x, aes(x = duration, y = log(phen.ach))) +
facet_grid(cols = vars(treatment)) +
geom_jitter(height=0, width = 0.0, alpha = 0.5) + geom_line(alpha = 0.3, aes(group = plot)) +
theme_few() +
labs(x = "Duration", y = "phen.ach")
data(oats)
summary(oats)
str(oats)
oats
# Recode nitrogen level as an ordered factor and then look at it to make sure that it has
# been ordered correctly so that 0.0cwt < 0.2cwt < 0.4cwt < 0.6cwt
oats$N <- ordered(oats$N)
oats$N
# Look at the data
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = N)) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen")
library(MASS)
data(oats)
summary(oats)
str(oats)
oats
# Recode nitrogen level as an ordered factor and then look at it to make sure that it has
# been ordered correctly so that 0.0cwt < 0.2cwt < 0.4cwt < 0.6cwt
oats$N <- ordered(oats$N)
oats$N
# Look at the data
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = N)) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen")
data(oats)
summary(oats)
str(oats)
oats
# Recode nitrogen level as an ordered factor and then look at it to make sure that it has
# been ordered correctly so that 0.0cwt < 0.2cwt < 0.4cwt < 0.6cwt
oats$N <- ordered(oats$N)
oats$N
# Look at the data
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = N)) + geom_line(aes(group = N))
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen")
data(oats)
summary(oats)
str(oats)
oats
# Recode nitrogen level as an ordered factor and then look at it to make sure that it has
# been ordered correctly so that 0.0cwt < 0.2cwt < 0.4cwt < 0.6cwt
oats$N <- ordered(oats$N)
oats$N
# Look at the data
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = N)) + geom_line(aes(group = N)) +
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen")
data(oats)
summary(oats)
str(oats)
oats
# Recode nitrogen level as an ordered factor and then look at it to make sure that it has
# been ordered correctly so that 0.0cwt < 0.2cwt < 0.4cwt < 0.6cwt
oats$N <- ordered(oats$N)
oats$N
# Look at the data
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = N)) + geom_line(aes(group = N, col = N)) +
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen")
data(oats)
summary(oats)
str(oats)
oats
# Recode nitrogen level as an ordered factor and then look at it to make sure that it has
# been ordered correctly so that 0.0cwt < 0.2cwt < 0.4cwt < 0.6cwt
oats$N <- ordered(oats$N)
oats$N
# Look at the data
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.1, alpha = 0.5, aes(col = N)) + geom_line(alpha = 0.3, aes(group = N, col = N)) +
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen")
data(oats)
summary(oats)
str(oats)
oats
# Recode nitrogen level as an ordered factor and then look at it to make sure that it has
# been ordered correctly so that 0.0cwt < 0.2cwt < 0.4cwt < 0.6cwt
oats$N <- ordered(oats$N)
oats$N
# Look at the data
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.0, alpha = 0.5, aes(col = N)) + geom_line(alpha = 0.3, aes(group = N, col = N)) +
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen")
# Something like the following plot
ggplot(data = oats, aes(x = N, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.0, alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V, col = V)) +
theme_few() +
labs(x = "Nitrogen", y = "Yield", color = "Variety")
ggplot(data = oats, aes(x = N, y = Y)) +
facet_grid(cols = vars(B)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V, col = V)) +
theme_few() +
labs(x = "Nitrogen", y = "Yield", color = "Variety")
x$N
oats$N
ggplot(data = oats, aes(x = N, y = Y)) +
facet_grid(cols = vars(B)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V, col = V)) +
theme_few() +
labs(x = "Nitrogen", y = "Yield", color = "Variety") +
scale_x_discrete(labels=c("0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6"))
oats$V
# Look at the data
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = N)) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen") +
scale_x_discrete(labels = c(
"Golden.rain" = "G", "Marvellous" = "M", "Victory" = "V"))
# Something like the following plot would show how increasing fertilizer has an effect
# on each of the different varieties in each block:
ggplot(data = oats, aes(x = N, y = Y)) +
facet_grid(cols = vars(B)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V, col = V)) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6"))
??color_blind
??colorblind
"Golden.rain" = "G", "Marvellous" = "M", "Victory" = "V")) + scale_color_colorblind()
ggplot(data = oats, aes(x = V, y = Y)) +
facet_grid(cols = vars(B)) +
geom_jitter(height=0, width = 0.1, alpha = 0.3, aes(col = N)) +
geom_pointrange(stat = "summary", fun.data = "mean_sdl", fun.args = list(mult = 1)) +
theme_few() +
labs(x = "Variety", y = "Yield", color = "Nitrogen") +
scale_x_discrete(labels = c(
"Golden.rain" = "G", "Marvellous" = "M", "Victory" = "V")) + scale_color_colorblind()
ggplot(data = oats, aes(x = N, y = Y)) +
facet_grid(cols = vars(B)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V, col = V)) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6")) + scale_color_colorblind()
ggplot(data = oats, aes(x = N, y = Y)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V, col = V)) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6")) + scale_color_colorblind()
ggplot(data = oats, aes(x = N, y = Y)) +
geom_point(alpha = 0.5, aes(group = V, col = V)) +
geom_line(alpha = 0.3, aes(group = V, col = V)) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6")) + scale_color_colorblind()
ggplot(data = oats, aes(x = N, y = Y, group = V)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V, col = V)) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6")) + scale_color_colorblind()
ggplot(data = oats, aes(x = N, y = Y)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(col = V)) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6")) + scale_color_colorblind()
ggplot(data = oats, aes(x = N, y = Y, group = V)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6")) + scale_color_colorblind()
ggplot(data = oats, aes(x = N, y = Y, group = V)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V:B, col = V)) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6")) + scale_color_colorblind()
ggplot(data = oats, aes(x = N, y = Y)) +
geom_point(alpha = 0.5, aes(col = V)) +
geom_line(alpha = 0.3, aes(group = V:B, col = V)) +
theme_few() +
labs(x = "Nitrogen (cwt)", y = "Yield", color = "Variety") +
scale_x_discrete(labels = c(
"0.0cwt" = "0", "0.2cwt" = "0.2", "0.4cwt" = "0.4", "0.6cwt" = "0.6")) + scale_color_colorblind()
install.packages(c("ggplot2", "GGally", "ggthemes"))
setwd("~/Documents/Teaching/UNB Courses/2018-2019/Experimental Design/Tutorials/Tutorial 2")
PolarBearData <- read.csv("Data/PolarBearData.csv")
View(PolarBearData)
str(data)
str(PolarBearData)
head(PolarBearData)
library(ggplot2)
library(GGally)
library(ggthemes)
SelectedData <- PolarBearData[,c("AgeClass", "Sex", "BodyLength.cm", "HeadLength.mm")]
View(SelectedData)
ggpairs(SelectedData)
ggplot(data = PolarBearData, aes(x = BodyLength.cm, y = HeadLength.mm))
?geom_smooth
ggplot(data = PolarBearData, aes(x = BodyLength.cm, y = HeadLength.mm))
ggplot(data = PolarBearData, aes(x = BodyLength.cm, y = HeadLength.mm)) + geom_point()
foo <- c(1, 2, 3, 4, 5)
foo
mean(foo)
foo <- c(1, 2, 3, 4, 5, NA)
foo
mean(foo)
sd(foo)
sd(foo, na.rm = TRUE)
mean(foo, na.rm = TRUE)
foo
foo[1] == 1
foo[2] == 2
foo[6] == NA
is.na(foo[6])
ggplot(data = PolarBearData,
aes(x = BodyLength.mm, y = HeadLength.mm, colour = Sex, fill = Sex, shape = Sex)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm") +
scale_fill_manual(values = c("red", "blue")) +
scale_colour_manual(values = c("red", "blue")) +
labs(x = "Body Length (cm)", y = "Head Length (mm)") +
theme_few()
ggplot(data = PolarBearData,
aes(x = BodyLength.mm, y = HeadLength.mm, colour = Sex, fill = Sex, shape = Sex)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm") +
scale_fill_manual(values = c("red", "blue")) +
scale_colour_manual(values = c("red", "blue")) +
labs(x = "Body Length (cm)", y = "Head Length (mm)") +
theme_few()
ggplot(data = PolarBearData,
aes(x = BodyLength.cm, y = HeadLength.mm, colour = Sex, fill = Sex, shape = Sex)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm") +
scale_fill_manual(values = c("red", "blue")) +
scale_colour_manual(values = c("red", "blue")) +
labs(x = "Body Length (cm)", y = "Head Length (mm)") +
theme_few()
ggplot(data = PolarBearData,
aes(x = BodyLength.cm, y = HeadLength.mm, colour = Sex, fill = Sex, shape = Sex)) +
geom_point(aes(alpha = 0.5)) +
geom_smooth(method = "lm") +
scale_fill_manual(values = c("red", "blue")) +
scale_colour_manual(values = c("red", "blue")) +
labs(x = "Body Length (cm)", y = "Head Length (mm)") +
theme_few()
ggplot(data = PolarBearData,
aes(x = BodyLength.cm, y = HeadLength.mm, colour = Sex, fill = Sex, shape = Sex)) +
geom_smooth(method = "lm") +
scale_fill_manual(values = c("red", "blue")) +
scale_colour_manual(values = c("red", "blue")) +
labs(x = "Body Length (cm)", y = "Head Length (mm)") +
theme_few()
ggplot(data = PolarBearData,
aes(x = BodyLength.cm, y = HeadLength.mm, fill = Sex, shape = Sex)) +
geom_smooth(method = "lm") +
scale_fill_manual(values = c("red", "blue")) +
scale_colour_manual(values = c("red", "blue")) +
labs(x = "Body Length (cm)", y = "Head Length (mm)") +
theme_few()
ggplot(data = PolarBearData,
aes(x = BodyLength.cm, y = HeadLength.mm, col = Sex, shape = Sex)) +
geom_smooth(method = "lm") +
scale_fill_manual(values = c("red", "blue")) +
scale_colour_manual(values = c("red", "blue")) +
labs(x = "Body Length (cm)", y = "Head Length (mm)") +
theme_few()
ggpairs(SelectedData)
?ggpairs
install.packages(c("ICC", "sjstats", "TukeyC"))
install.packages("mvtnorm")
install.packages("emmeans")
install.packages("HH")
?geom_histogram
library(ggplot2)
?geom_histogram
?geom_count
?ggsave
`ggsave("plot.pdf")`
ggsave("mtcars.pdf", colormodel = "cmyk")
ggplot(mtcars, aes(mpg, wt)) +
geom_point()
?pdf
?jpg
?jpeg
?geom_count
library(ggplot2)
?geom_density
library(ggplot2)
?geom_smooth
??3779772
??scale_color_colorblind
library("ggplot2")
library("scales")
show_col(colorblind_pal()(8))
library(ggthemes)
library("ggplot2")
library("scales")
show_col(colorblind_pal()(8))
p <- ggplot(mtcars) +
geom_point(aes(
x = wt,
y = mpg,
colour = factor(gear)
)) +
facet_wrap(~am)
p + theme_igray() + scale_colour_colourblind()
